
  ___  ____  ____  ____  ____ (R)
 /__    /   ____/   /   ____/
___/   /   /___/   /   /___/   15.1   Copyright 1985-2017 StataCorp LLC
  Statistics/Data Analysis            StataCorp
                                      4905 Lakeway Drive
     MP - Parallel Edition            College Station, Texas 77845 USA
                                      800-STATA-PC        http://www.stata.com
                                      979-696-4600        stata@stata.com
                                      979-696-4601 (fax)

32-user 64-core Stata network perpetual license:
       Serial number:  501506200495
         Licensed to:  Harvard-MIT Data Center
                       Cambridge, MA

Notes:
      1.  Stata is running in batch mode.
      2.  Unicode is supported; see help unicode_advice.
      3.  More than 2 billion observations are allowed; see help obs_advice.
      4.  Maximum number of variables is set to 5000; see help set_maxvar.

. do "dofiles/3_estimates_figure4.do" 

. /****************************************************************************
> *****************************
> Replication Files for Housing Discrimination and the Toxics Exposure Gap in t
> he United States: 
> Evidence from the Rental Market  by Peter Christensen, Ignacio Sarmiento-Barb
> ieri and Christopher Timmins
> *****************************************************************************
> ****************************/
. 
. 
. clear all

. set matsize 11000

. 
. use "../stores/toxic_discrimination_data.dta"

. 
. 
. keep if sample==1
(801 observations deleted)

. 
. loc quartiles 4

. 
. set seed 1010101

. 
. *****************************************************************************
> *******************
. * Minority
. *****************************************************************************
> *******************
. * Within 1 more than 1
. *****************************************************************************
> *******************
. 
. 
. disc_boot choice  Minority_within1  Minority_more1 , varlist(i.gender i.educa
> tion_level i.order)
note: multiple positive outcomes within groups encountered.
note: 1,331 groups (3,993 obs) dropped because of all positive or
      all negative outcomes.

Iteration 0:   log pseudolikelihood = -927.96374  
Iteration 1:   log pseudolikelihood = -920.17814  
Iteration 2:   log pseudolikelihood = -920.15913  
Iteration 3:   log pseudolikelihood = -920.15913  

Conditional (fixed-effects) logistic regression

                                                Number of obs     =      2,730
                                                Wald chi2(7)      =      84.74
                                                Prob > chi2       =     0.0000
Log pseudolikelihood = -920.15913               Pseudo R2         =     0.0796

                              (Std. Err. adjusted for 14 clusters in Zip_Code)
------------------------------------------------------------------------------
             |               Robust
      choice |      Coef.   Std. Err.      z    P>|z|     [90% Conf. Interval]
-------------+----------------------------------------------------------------
Minority_w~1 |  -.1191289   .1396969    -0.85   0.394    -.3489098    .1106521
Minority_m~1 |  -.4127944   .1093093    -3.78   0.000    -.5925923   -.2329966
             |
      gender |
       male  |  -.3208997   .0892099    -3.60   0.000     -.467637   -.1741625
             |
education_~l |
        low  |  -.1822504   .1158593    -1.57   0.116    -.3728221    .0083212
     medium  |  -.2959499   .1392686    -2.13   0.034    -.5250263   -.0668735
             |
       order |
          2  |   -.343484   .2396691    -1.43   0.152    -.7377047    .0507366
          3  |  -.9051545    .201436    -4.49   0.000    -1.236487   -.5738217
------------------------------------------------------------------------------
cluster(Zip_Code)Zip_Codecluster(Zip_Code)Zip_Code

Bootstrap Corrected Estimates
------------------------------------------------------------------------------
             |      Coef.   Std. Err.      t    P>|t|     [90% Conf. Interval]
-------------+----------------------------------------------------------------
Minority_w~1 |  -.1191289   .1425262    -0.84   0.418    -.3715332    .1332755
Minority_m~1 |  -.4127944   .1280479    -3.22   0.007    -.6395587   -.1860301
------------------------------------------------------------------------------

. 
. mat def b=e(b)

. mat def V=e(V)

. 
. mat def R=J(2,3,.)

. 
. forvalues i= 1/2{
  2.         mat R[`i',1]=b[1,`i']
  3.         mat R[`i',2]=V[`i',`i']
  4.         mat R[`i',3]=e(df_`i')
  5.         }

. 
. matrix define B=J(2,5,.)

. 
. forvalues i= 1/2{
  2.         matrix B[`i',1] =  R[`i',1] - invttail(R[`i',3],0.05)*sqrt(R[`i',2
> ])
  3.         matrix B[`i',2] =  R[`i',1] 
  4.         matrix B[`i',3] =  R[`i',1] + invttail(R[`i',3],0.05)*sqrt(R[`i',2
> ])
  5. }

. 
.         
.         
. 
. 
.         sum Minority if within1==1

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
    Minority |      3,252    .6666667     .471477          0          1

.         matrix B[1,4]=`r(N)'

. 
.         sum Minority if more1==1

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
    Minority |      3,471    .6666667    .4714724          0          1

.         matrix B[2,4]=`r(N)'

.         
. 
.         sum choice if White==1 &  within1==1

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
      choice |      1,084    .3957565    .4892383          0          1

.         matrix B[1,5]=`r(mean)'

. 
.         sum choice if White==1 &  more1==1

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
      choice |      1,157    .3932584    .4886846          0          1

.         matrix B[2,5]=`r(mean)'

. mat list B      

B[2,5]
            c1          c2          c3          c4          c5
r1  -.37153324  -.11912886   .13327552        3252   .39575646
r2  -.63955875  -.41279443  -.18603011        3471   .39325843

. 
. 
. 
. 
. *****************************************************************************
> *******************
. * Matrix to dta
. *****************************************************************************
> *******************
. preserve

. clear

. svmat B
number of observations will be reset to 2
Press any key to continue, or Break to abort
number of observations (_N) was 0, now 2

. gen n=_n

. replace B1=exp(B1)
(2 real changes made)

. replace B2=exp(B2)
(2 real changes made)

. replace B3=exp(B3)
(2 real changes made)

. 
. 
. 
. rename B1 lci

. rename B2 or

. rename B3 uci

. rename B4 obs

. rename B5 c_mean

. rename n distance

. 
. 
. save "../stores/aux/distance_minority_bootcl.dta"       , replace
(note: file ../stores/aux/distance_minority_bootcl.dta not found)
file ../stores/aux/distance_minority_bootcl.dta saved

. restore

. 
. *****************************************************************************
> *******************
. * African American vs Hispanic/LatinX
. *****************************************************************************
> *******************
. * Within 1 more than 1
. *****************************************************************************
> *******************
. disc_boot choice  Hispanic_within1  Hispanic_more1  ///
>                                           Black_within1  Black_more1  ///
>                                           , varlist(i.gender i.education_leve
> l i.order)
note: multiple positive outcomes within groups encountered.
note: 1,331 groups (3,993 obs) dropped because of all positive or
      all negative outcomes.

Iteration 0:   log pseudolikelihood = -912.97182  
Iteration 1:   log pseudolikelihood = -904.06377  
Iteration 2:   log pseudolikelihood = -904.01323  
Iteration 3:   log pseudolikelihood = -904.01323  

Conditional (fixed-effects) logistic regression

                                                Number of obs     =      2,730
                                                Wald chi2(9)      =     132.79
                                                Prob > chi2       =     0.0000
Log pseudolikelihood = -904.01323               Pseudo R2         =     0.0957

                              (Std. Err. adjusted for 14 clusters in Zip_Code)
------------------------------------------------------------------------------
             |               Robust
      choice |      Coef.   Std. Err.      z    P>|z|     [90% Conf. Interval]
-------------+----------------------------------------------------------------
Hispanic_w~1 |   .1408006   .0972992     1.45   0.148    -.0192423    .3008435
Hispanic_m~1 |  -.1898481   .0784416    -2.42   0.016    -.3188731   -.0608231
Black_with~1 |  -.3696098   .2097833    -1.76   0.078    -.7146727   -.0245469
 Black_more1 |    -.65107   .1526792    -4.26   0.000     -.902205   -.3999351
             |
      gender |
       male  |  -.3127156   .0925256    -3.38   0.001    -.4649066   -.1605246
             |
education_~l |
        low  |  -.2227868   .1254627    -1.78   0.076    -.4291545    -.016419
     medium  |  -.3160507   .1325095    -2.39   0.017    -.5340094   -.0980919
             |
       order |
          2  |  -.3392887   .2482428    -1.37   0.172    -.7476118    .0690343
          3  |  -.9105731    .210472    -4.33   0.000    -1.256769   -.5643776
------------------------------------------------------------------------------
cluster(Zip_Code)Zip_Codecluster(Zip_Code)Zip_Codecluster(Zip_Code)Zip_Codeclus
> ter(Zip_Code)Zip_Code

Bootstrap Corrected Estimates
------------------------------------------------------------------------------
             |      Coef.   Std. Err.      t    P>|t|     [90% Conf. Interval]
-------------+----------------------------------------------------------------
Hispanic_w~1 |   .1408006   .1032163     1.36   0.196    -.0419886    .3235898
Hispanic_m~1 |  -.1898481   .0873971    -2.17   0.049    -.3446225   -.0350737
Black_with~1 |  -.3696098   .2265961    -1.63   0.127    -.7708965    .0316768
 Black_more1 |    -.65107   .1787903    -3.64   0.003    -.9676957   -.3344444
------------------------------------------------------------------------------

. 
. mat def b=e(b)

. mat def V=e(V)

. 
. mat def R=J(4,3,.)

. 
. forvalues i= 1/4{
  2.         mat R[`i',1]=b[1,`i']
  3.         mat R[`i',2]=V[`i',`i']
  4.         mat R[`i',3]=e(df_`i')
  5.         }

. 
. 
. matrix define H=J(2,5,.)

. forvalues i= 1/2{
  2.         matrix H[`i',1] =  R[`i',1] - invttail(R[`i',3],0.05)*sqrt(R[`i',2
> ])
  3.         matrix H[`i',2] =  R[`i',1] 
  4.         matrix H[`i',3] =  R[`i',1] + invttail(R[`i',3],0.05)*sqrt(R[`i',2
> ])
  5. }

. 
.         sum Hispanic if within1==1

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
    Hispanic |      3,252    .3333333     .471477          0          1

.         matrix H[1,4]=`r(N)'

. 
.         sum Hispanic if more1 ==1

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
    Hispanic |      3,471    .3333333    .4714724          0          1

.         matrix H[2,4]=`r(N)'

.         mat list H

H[2,5]
            c1          c2          c3          c4          c5
r1  -.04198857   .14080059   .32358975        3252           .
r2   -.3446225  -.18984809  -.03507368        3471           .

. 
.         sum choice if White==1 &  within1==1

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
      choice |      1,084    .3957565    .4892383          0          1

.         matrix H[1,5]=`r(mean)'

. 
.         sum choice if White==1 &  more1==1

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
      choice |      1,157    .3932584    .4886846          0          1

.         matrix H[2,5]=`r(mean)'

.         mat list H

H[2,5]
            c1          c2          c3          c4          c5
r1  -.04198857   .14080059   .32358975        3252   .39575646
r2   -.3446225  -.18984809  -.03507368        3471   .39325843

. 
. 
. matrix define B=J(2,5,.)

. 
. forvalues i= 1/2{
  2.         matrix B[`i',1] =  R[`i'+2,1] - invttail(R[`i'+2,3],0.05)*sqrt(R[`
> i'+2,2])
  3.         matrix B[`i',2] =  R[`i'+2,1] 
  4.         matrix B[`i',3] =  R[`i'+2,1] + invttail(R[`i'+2,3],0.05)*sqrt(R[`
> i'+2,2])
  5. }

. 
. 
.         sum Black if within1==1

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
       Black |      3,252    .3333333     .471477          0          1

.         matrix B[1,4]=`r(N)'

. 
.         sum Black if more1==1

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
       Black |      3,471    .3333333    .4714724          0          1

.         matrix B[2,4]=`r(N)'

.         mat list B

B[2,5]
            c1          c2          c3          c4          c5
r1  -.77089648  -.36960983   .03167683        3252           .
r2  -.96769569  -.65107004  -.33444439        3471           .

. 
.         sum choice if White==1 &  within1==1

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
      choice |      1,084    .3957565    .4892383          0          1

.         matrix B[1,5]=`r(mean)'

. 
.         sum choice if White==1 &  more1==1

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
      choice |      1,157    .3932584    .4886846          0          1

.         matrix B[2,5]=`r(mean)'

.         mat list B

B[2,5]
            c1          c2          c3          c4          c5
r1  -.77089648  -.36960983   .03167683        3252   .39575646
r2  -.96769569  -.65107004  -.33444439        3471   .39325843

. 
. 
. 
. 
. *****************************************************************************
> *******************
. * Matrix to dta
. *****************************************************************************
> *******************
. preserve

. clear

. svmat B
number of observations will be reset to 2
Press any key to continue, or Break to abort
number of observations (_N) was 0, now 2

. gen n=_n

. replace B1=exp(B1)
(2 real changes made)

. replace B2=exp(B2)
(2 real changes made)

. replace B3=exp(B3)
(2 real changes made)

. 
. 
. 
. rename B1 lci

. rename B2 or

. rename B3 uci

. rename B4 obs

. rename B5 c_mean

. rename n distance

. 
. 
. 
. save "../stores/aux/distance_race_afam_bootcl.dta"      , replace
(note: file ../stores/aux/distance_race_afam_bootcl.dta not found)
file ../stores/aux/distance_race_afam_bootcl.dta saved

. restore

. 
. preserve

. clear

. svmat H
number of observations will be reset to 2
Press any key to continue, or Break to abort
number of observations (_N) was 0, now 2

. gen n=_n

. replace H1=exp(H1)
(2 real changes made)

. replace H2=exp(H2)
(2 real changes made)

. replace H3=exp(H3)
(2 real changes made)

. 
. 
. 
. rename H1 lci

. rename H2 or

. rename H3 uci

. rename H4 obs

. rename H5 c_mean

. rename n distance

. 
. 
. 
. save "../stores/aux/distance_race_hispanic_bootcl.dta"  , replace
(note: file ../stores/aux/distance_race_hispanic_bootcl.dta not found)
file ../stores/aux/distance_race_hispanic_bootcl.dta saved

. restore

. 
. 
. clogit choice Hispanic_within1  Hispanic_more1  ///
>                                           Black_within1  Black_more1  ///
>                                           i.order i.gender  i.education_level
>  , group(Address) or  cl(Zip_Code) level(90)
note: multiple positive outcomes within groups encountered.
note: 1,331 groups (3,993 obs) dropped because of all positive or
      all negative outcomes.

Iteration 0:   log pseudolikelihood = -912.97182  
Iteration 1:   log pseudolikelihood = -904.06377  
Iteration 2:   log pseudolikelihood = -904.01323  
Iteration 3:   log pseudolikelihood = -904.01323  

Conditional (fixed-effects) logistic regression

                                                Number of obs     =      2,730
                                                Wald chi2(9)      =     132.79
                                                Prob > chi2       =     0.0000
Log pseudolikelihood = -904.01323               Pseudo R2         =     0.0957

                              (Std. Err. adjusted for 14 clusters in Zip_Code)
------------------------------------------------------------------------------
             |               Robust
      choice | Odds Ratio   Std. Err.      z    P>|z|     [90% Conf. Interval]
-------------+----------------------------------------------------------------
Hispanic_w~1 |   1.151195   .1120103     1.45   0.148     .9809417    1.350998
Hispanic_m~1 |   .8270848   .0648779    -2.42   0.016     .7269678    .9409897
Black_with~1 |   .6910039   .1449611    -1.76   0.078     .4893522    .9757519
 Black_more1 |   .5214875   .0796203    -4.26   0.000     .4056742    .6703636
             |
       order |
          2  |   .7122768   .1768176    -1.37   0.172      .473496    1.071473
          3  |   .4022936   .0846715    -4.33   0.000     .2845721     .568714
             |
      gender |
       male  |   .7314579   .0676786    -3.38   0.001     .6281938    .8516969
             |
education_~l |
        low  |   .8002855    .100406    -1.78   0.076     .6510593     .983715
     medium  |   .7290225   .0966024    -2.39   0.017     .5862497    .9065656
------------------------------------------------------------------------------

. 
. 
. 
. 
. 
. 
. 
. 
. 
. *end
. 
end of do-file
